<clr-datagrid (clrDgRefresh)="refresh($event)" class="wayne-clr-datagrid">
  <clr-dg-placeholder>暂无数据！</clr-dg-placeholder>
  <clr-dg-column class="col-id">
    <ng-container>
      #
    </ng-container>
  </clr-dg-column>
  <clr-dg-column class="col-time">
    <ng-container *clrDgHideableColumn="showState['创建时间']">
      创建时间
    </ng-container>
  </clr-dg-column>
  <clr-dg-column class="col-cluster">
    <ng-container *clrDgHideableColumn="showState['配置机房']">
      配置机房
    </ng-container>
  </clr-dg-column>
  <clr-dg-column class="col-cluster">
    <ng-container *clrDgHideableColumn="showState['已上线机房']">
      已上线机房
    </ng-container>
  </clr-dg-column>
  <clr-dg-column class="col-description">
    <ng-container *clrDgHideableColumn="showState['发布说明']">
      发布说明
    </ng-container>
  </clr-dg-column>
  <clr-dg-column>
    <ng-container *clrDgHideableColumn="showState['创建者']">
      创建者
    </ng-container>
  </clr-dg-column>
  <clr-dg-column class="col-operate">
    <ng-container *clrDgHideableColumn="showState['操作']">
      操作
    </ng-container>
  </clr-dg-column>
  <clr-dg-row *ngFor="let configMapTpl of configMapTpls" [clrDgItem]="configMapTpl">
    <clr-dg-cell class="col-id">{{configMapTpl.id}}</clr-dg-cell>
    <clr-dg-cell class="col-time">{{configMapTpl.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</clr-dg-cell>
    <clr-dg-cell class="col-cluster">
      <div class="form-group" style="padding-bottom: 2px" *ngFor="let cluster of configMapTpl.clusters">
        {{cluster}}
      </div>

    </clr-dg-cell>
    <clr-dg-cell class="col-cluster">
      <div class="form-group" style="padding-bottom: 2px" *ngFor="let status of configMapTpl.status">
          {{status.cluster}}&nbsp;<clr-icon style="color: #FF3434" shape="exclamation-triangle" *ngIf="status.state == 1" class="is-solid"></clr-icon>
          <clr-icon style="color: green" shape="success-standard" *ngIf="status.state == 0" class="is-solid"></clr-icon>
      </div>
    </clr-dg-cell>
    <clr-dg-cell class="col-description">
      <div class="text-overflow">
        <a href="javascript:void(0)" (click)="tplDetail(configMapTpl)">{{configMapTpl.description}}</a>
      </div>
    </clr-dg-cell>
    <clr-dg-cell>{{configMapTpl.user}}</clr-dg-cell>
    <clr-dg-cell class="col-operate">
      <button class="wayne-button text"
        (click)="publishConfigMapTpl(configMapTpl)"
        *ngIf="authService.currentAppPermission.configmap.deploy || authService.currentUser.admin">
        发布</button>
      <button class="wayne-button text"
        (click)="detailConfigMapTpl(configMapTpl)"
        *ngIf="authService.currentAppPermission.configmap.read || authService.currentUser.admin">
        详情</button>
      <button class="wayne-button text"
        (click)="cloneConfigMapTpl(configMapTpl)"
        *ngIf="authService.currentAppPermission.configmap.create || authService.currentUser.admin">
        克隆</button>
      <button class="wayne-button text"
        *ngIf="!configMapTpl.status && (authService.currentAppPermission.configmap.delete || authService.currentUser.admin)"
        (click)="deleteConfigMapTpl(configMapTpl)">
        删除</button>
      <button class="wayne-button text"
         (click)="offlineConfigMapTpl(configMapTpl)"
         *ngIf="configMapTpl.status && (authService.currentAppPermission.configmap.offline || authService.currentUser.admin)">
         下线</button>
    </clr-dg-cell>
  </clr-dg-row>

  <wayne-paginate
    [(currentPage)]="currentPage"
    [total]="page.totalCount"
    [pageSizes]="[10, 20, 50]"
    (sizeChange)="pageSizeChange($event)"
  >
  </wayne-paginate>
</clr-datagrid>
<wayne-ace-editor></wayne-ace-editor>
<publish-tpl (published)="published($event)"></publish-tpl>
